package pine.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import pine.web.common.grid.Pagination;
import pine.web.model.User;
import pine.web.service.UserService;

@Controller("UserController")
@RequestMapping("user")
public class UserController {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("add")
	public @ResponseBody String add() {
		this.userService.test();
		return "";
	}
	
	@RequestMapping("list")
	public String list() {
		return "user/userList";
	}
	
	@RequestMapping("list/page")
	public @ResponseBody Pagination<User> page() {
		return userService.findUserByPage();
	}
	
	@RequestMapping("list/liger/page")
	public @ResponseBody Pagination<User> ligerpage() {
		return userService.findUserByPage();
	}
	
}
